<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="/dist/css/AdminLTE.css">
    <link rel="stylesheet" href="/dist/css/skins/_all-skins.min.css">
    <!-- 以上为公共css -->

    <link rel="stylesheet" href="/plugins/iCheck/flat/blue.css">
    <link rel="stylesheet" href="/plugins/selectpage/selectpage.bootstrap3.css">
</head>

<div class="diy_table_panel">
    <div class="diy_table_head row">
        <form>
            <div class="col-xs-2">
                <div class="input-group">
                    <span class="input-group-addon">下拉框</span>
                    <input type="text" class="form-control"
                           style="border-radius: 0;border-color: #d2d6de;background-color: #fff;"
                           id="selectPage">
                </div>
            </div>

            <div class="col-xs-2">
                <div class="input-group">
                    <span class="input-group-addon">姓名</span>
                    <input type="text" name="name" class="form-control">
                </div>
            </div>

            <div class="col-xs-2">
                <div class="input-group">
                    <span class="input-group-addon">描述</span>
                    <input type="text" name="content" class="form-control">
                </div>
            </div>
            <div class="col-xs-4">
                <button class="btn btn-primary btnSearch" type="submit">搜索</button>
            </div>
        </form>
    </div>
    <div class="diy_table_body box">
        <div class="box-body">
            <div class="mailbox-controls">
                <!-- Check all button -->
                <button type="button" class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></button>
                <button type="button" class="btn btn-default btn-sm" data-layer="/page/add.html" data-layer-h="500px"
                        data-layer-top="10px" data-layer-w="800px" data-layer-title="新增">
                    <i class=" fa fa-plus-square"></i>
                </button>
                <button type="button" class="btn btn-default btn-sm"><i class="fa fa-trash-o"></i></button>

                <!-- /.pull-right -->
            </div>
            <table class="table table-bordered table-hover">
                <thead>
                <tr>
                    <th data-chkbox="1">全选</th>
                    <th name="id">id</th>
                    <th name="name">姓名</th>
                    <th name="age">年龄</th>
                    <th name="content">描述</th>
                    <th name="add_time" data-type="datetime_">时间</th>
                    <th name="id" data-handel="1" style="text-align: center;" data-style="text-align: center">操作
                        <div class="hidden">
                            <button class="btn btn-sm btn-info"
                                    data-layer="/page/add.html?id={id}" data-layer-h="500px" data-layer-top="10px"
                                    data-layer-w="800px" data-layer-title="修改">修改
                            </button>
                            <button class="btn btn-sm btn-danger" data-id="{id}">删除</button>
                        </div>
                    </th>
                </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>
    <div class="diy_table_foot" id="paging">
    </div>
</div>
<script src="/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="/plugins/jQuery/jquery.form.min.js"></script>
<script src="/plugins/jQuery/jquery.cookie.js"></script>
<script src="/plugins/layer/layer.js"></script>
<script src="/plugins/laypage/laypage.js"></script>
<script src="/plugins/iCheck/icheck.min.js"></script>
<script src="/plugins/selectpage/selectpage.js"></script>
<script src="/static/js/core.js"></script>
<script src="/static/js/core.ajax.js"></script>
<script src="/static/js/core.databind.js"></script>
<script>
    var is_need_login = true;

    $(function () {
        page();
    });

    function page() {
        BindData.bindPage({
            url: "/table/page", data: {a: 1, b: 2}, handle: function () {
            }
        });
    }

    BindData.delete({
        item: ".btn-danger",
        url: "/delete",
        endMethod: "page"
    });

    var tag_data = [
        {id: 1, name: 'Chicago Bulls', desc: '芝加哥公牛'},
        {id: 2, name: 'Cleveland Cavaliers', desc: '克里夫兰骑士'},
        {id: 3, name: 'Detroit Pistons', desc: '底特律活塞'},
        {id: 4, name: 'Indiana Pacers', desc: '印第安纳步行者'}
    ];

    //初始化插件  后续研究
    $('#selectPage').selectPage({
        showField: 'desc',
        keyField: 'id',
        data: tag_data
    });

</script>


</html>